{% extends "base.html" %}

{% block title %}{{ user.username }}的个人主页 - {{ config.SITE_NAME }}{% endblock %}

{% block content %}
<!-- 用户信息 -->
<div class="row mb-5">
    <div class="col-md-3 text-center">
        <img src="{{ user.avatar_url }}" alt="{{ user.username }}" class="rounded-circle img-fluid mb-3" style="max-width: 200px;">
        <h3>{{ user.username }}</h3>
        <p class="text-muted">加入时间：{{ user.join_date.strftime('%Y-%m-%d') }}</p>
        {% if current_user.is_authenticated and current_user.id == user.id %}
        <a href="{{ url_for('main_zyy.edit_profile_zyy') }}" class="btn btn-primary">编辑主页</a>
        {% endif %}
    </div>
    <div class="col-md-9">
        <!-- 个人主页内容 -->
        {% for section in profile_sections %}
        <div class="card mb-4" id="{{ section.section_type }}">
            <div class="card-body">
                <h4 class="card-title">{{ section.title }}</h4>
                {% if section.image_url %}
                <img src="{{ section.image_url }}" alt="{{ section.title }}" class="img-fluid rounded mb-3">
                {% endif %}
                <p class="card-text">{{ section.content }}</p>
            </div>
        </div>
        {% endfor %}
    </div>
</div>
{% endblock %} 